package com.example.jerry.test;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;

import com.example.loginandpaytools.LoginAndPayToolSDK;
import com.example.loginandpaytools.Support.Configuration;
import com.example.loginandpaytools.common.Config;

public class PayActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_pay);

        setConfig();

        Config.setOrder("order_name", "order_num", 1);

        Button btn = (Button) findViewById(R.id.test_pay);
        btn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                /**
                 * 打开支付界面
                 */
                LoginAndPayToolSDK.openPayInterface(PayActivity.this, "支付0.01元");
            }
        });
    }

    private void setConfig() {
        //相关的值需要替换
        //透传参数
        Configuration.setEXT("2");
    }

}
